package com.hmkj.core.mapper.operate;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.model.operate.BannerModel;
import com.hmkj.core.po.operate.Banner;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * banner表相关Dao接口<br>
 *
 * @author eproo
 * @date   2017-12-01 11:53:53
 */
public interface BannerMapper extends GenericMapper< Banner,Integer> {

    @Select("SELECT t.*,agent.name AS 'agent.name' FROM biz_banner t LEFT JOIN biz_agent agent ON agent.id = t.agent_id WHERE 1=1 ${whereSql} ${sortSql} limit ${nowPage}, ${pageSize} ")
    List<BannerModel> findListBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1) FROM biz_banner t LEFT JOIN biz_agent agent ON agent.id = t.agent_id WHERE 1=1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);

    @Select("SELECT t.* FROM biz_banner t WHERE 1=1 ${whereSql} ${sortSql} ")
    List<Banner> findBannerListBySql(Map<String, Object> params);
}
